package com.qf.spring.service.impl;

import com.qf.spring.dao.UserDao;
import com.qf.spring.service.UserService;

/**
 * @author 郑大仙丶
 * @version 1.0
 * @date 2021/3/18 17:25
 */
public class UserServiceImpl implements UserService {

    private UserDao userDao;

    private String name;

    private Integer age;
    /*public void setUserDao(UserDao userDao) {
        System.out.println("给userDao属性赋值.");
        this.userDao = userDao;
    }*/

    public UserServiceImpl(UserDao userDao) {
        System.out.println("有参创建对象，并给属性赋值");
        this.userDao = userDao;
    }

    public UserServiceImpl(String name) {
        this.name = name;
    }

    public UserServiceImpl(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    public UserServiceImpl(UserDao userDao, String name, Integer age) {
        this.userDao = userDao;
        this.name = name;
        this.age = age;
    }

    @Override
    public void save() {
        userDao.save();
    }
}
